//
//  UIFont+Extend.m
//  RMMaterialRed
//
//  Created by XBWH on 2024/3/5.
//

#import <UIKit/UIKit.h>
static NSString *const rb_Regular = @"PingFangSC-Regular";
static NSString *const rb_Semibold = @"PingFangSC-Semibold";
static NSString *const rb_Light = @"PingFangSC-Light";
static NSString *const rb_Medium = @"PingFangSC-Medium";
static NSString *const rb_Heavy = @"Avenir-Heavy";

#import "UIFont+Extend.h"
#import <objc/runtime.h>

@implementation UIFont (Extend)
+(instancetype)rb_RegularFontOfSize:(CGFloat)fontSize{
    return [self rb_configure:fontSize style:rb_Regular];
}
+(instancetype)rb_SemiboldFontOfSize:(CGFloat)fontSize{
    return [self rb_configure:fontSize style:rb_Semibold];
}
+(instancetype)rb_LightFontOfSize:(CGFloat)fontSize{
    return [self rb_configure:fontSize style:rb_Light];
}
+(instancetype)rb_MediumFontOfSize:(CGFloat)fontSize{
    return [self rb_configure:fontSize style:rb_Medium];
}
+(instancetype)rb_HeavyFontOfSize:(CGFloat)fontSize{
    return [self rb_configure:fontSize style:rb_Heavy];
}
+ (instancetype)rb_configure:(CGFloat)font style:(NSString *)style{
    if (RBScreenWidth == 320) {
        return  [UIFont fontWithName:style size:font-1];
    }else if (RBScreenWidth == 375){
        return  [UIFont fontWithName:style size:(font)];
    }else{
        return  [UIFont fontWithName:style size:(font + 1)];
    }
}
@end
